home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Languguage OS 2
/
Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO
/
a_utils
/
expanded.lha
/
test_suite
/
testsub.C
< prev
next >
Wrap
C/C++ Source or Header
|
1992-03-19
|
28KB
|
942 lines
//
// Linear-Affine-Projective Geometry Package
//
// testsub.C
//
// $Header$
//
// William J.R. Longabaugh
// University of Washington
//
// Test runs for the linear-affine-projective geometry
// package described in William J.R. Longabaugh, "An Expanded
// System for Coordinate-Free Geometric Programming", Master's
// thesis, University of Washington, 1992.
//
// Copyright (c) 1992, William J.R. Longabaugh
// Copying, use and development for non-commercial purposes permitted.
// All rights for commercial use reserved.
// This software is unsupported and without warranty; it is
// provided "as is".
//
// ***********************************************************************
#include "Lap.h"
#include <math.h>
extern void test1(void);
extern void truth(Boolean res, Boolean expect);
extern void beauty(void);
static int count = 0;
// ***********************************************************************
int main(void)
{
test1();
return (0);
}
// ***********************************************************************
void truth(Boolean res, Boolean expect)
{
if (res != expect) {
cout << "Failure at: " << count << "\n";
}
count++;
}
// ***********************************************************************
void beauty(void)
{
cout << "Now at: " << count << "\n";
}
// ***********************************************************************
// Test the constructors for subsets
void test1(void)
{
cout << "ENTERING TEST1\n";
VSpace v("Test vector space", 4, TRUE);
ASpace a("Test affine space", 3, TRUE);
PSpace p("Test projective space", v, a);
VSpace t = a.GetSpace(TANGENT);
Frame fra = a.StdBasis();
VBasis vbas = v.StdBasis();
HFrame hfr = p.StdBasis();
VBasis tbas = t.StdBasis();
Vector v1(vbas, ScalarList(6.7, 3.4, 2.8, 1.2));
Vector v2(vbas, ScalarList(2.5, 5.7, 1.3, 9.5));
Vector v3(vbas, ScalarList(7.9, 3.5, 4.1, 2.7));
Vector v4(vbas, ScalarList(7.3, 4.6, 2.2, 9.3));
VectorEC v1ec = v1.MapTo(VEC_EC);
VectorEC v2ec = v2.MapTo(VEC_EC);
VectorEC v3ec = v3.MapTo(VEC_EC);
VectorEC v4ec = v4.MapTo(VEC_EC);
APoint p1(fra, ScalarList(6.7, 3.4, 2.8, 1.0));
APoint p2(fra, ScalarList(3.6, 2.5, -2.1, 1.0));
APoint p3(fra, ScalarList(2.2, 1.9, -0.3, 1.0));
APoint p4(fra, ScalarList(2.5, 1.6, 7.4, 1.0));
AVector t1(tbas, ScalarList(3.4, 2.8, 1.2));
AVector t2(tbas, ScalarList(2.5, 1.3, 9.5));
AVector t3(tbas, ScalarList(7.9, 3.5, 2.7));
AVectorEC t1ec = t1.MapTo(AFF_VEC_EC);
AVectorEC t2ec = t2.MapTo(AFF_VEC_EC);
AVectorEC t3ec = t3.MapTo(AFF_VEC_EC);
PPoint pp1(hfr, ScalarList(6.7, 3.4, 2.8, 3.4));
PPoint pp2(hfr, ScalarList(3.6, 2.5, -2.1, 3.1));
PPoint pp3(hfr, ScalarList(2.2, 1.9, -0.3, 5.1));
PPoint pp4(hfr, ScalarList(7.4, 1.0, 2.5, 1.6));
VSubSet vs1d("vs1d", v, GeObList(v1));
VSubSet vs2d("vs2d", v, GeObList(v1, v2));
VSubSet vs3d("vs3d", v, GeObList(v1, v2, v3));
VSubSet vs4d("vs4d", v, GeObList(v1, v2, v3, v4));
VSubSet ts1d("ts1d", t, GeObList(t1));
VSubSet ts2d("ts2d", t, GeObList(t1, t2));
VSubSet ts3d("ts3d", t, GeObList(t1, t2, t3));
ASubSet as0dv("as0dv", v, GeObList(v1));
ASubSet as1dv("as1dv", v, GeObList(v1, v2));
ASubSet as2dv("as2dv", v, GeObList(v1, v2, v3));
ASubSet as3dv("as3dv", v, GeObList(v1, v2, v3, v4));
ASubSet as0dt("as0dt", t, GeObList(t1));
ASubSet as1dt("as1dt", t, GeObList(t1, t2));
ASubSet as2dt("as2dt", t, GeObList(t1, t2, t3));
ASubSet as0da("as0da", a, GeObList(p1));
ASubSet as1da("as1da", a, GeObList(p1, p2));
ASubSet as2da("as2da", a, GeObList(p1, p2, p3));
Vector hold = p3.MapTo(VECTOR);
ASubSet as3da("as3da", a, GeObList(p1, p2, hold, p4));
ASubSet as1dp("as1dp", p, pp1, GeObList(pp2));
ASubSet as2dp("as2dp", p, pp1, GeObList(pp2, pp3));
VectorEC holdec = pp3.MapTo(VEC_EC);
ASubSet as3dp("as3dp", p, pp1, GeObList(pp2, holdec, pp4));
PSubSet ps0dp("ps0dp", p, GeObList(pp1));
PSubSet ps1dp("ps1dp", p, GeObList(pp1, pp2));
PSubSet ps2dp("ps2dp", p, GeObList(pp1, pp2, pp3));
PSubSet ps3dp("ps3dp", p, GeObList(pp1, pp2, holdec, pp4));
PSubSet ps0dv("ps0dp", v, GeObList(v1ec));
PSubSet ps1dv("ps1dp", v, GeObList(v1ec, v2ec));
PSubSet ps2dv("ps2dp", v, GeObList(v1ec, v2ec, v3ec));
PSubSet ps3dv("ps3dp", v, GeObList(v1ec, v2, v3ec, v4ec));
PSubSet ps0dt("ps0dt", t, GeObList(t1ec));
PSubSet ps1dt("ps1dt", t, GeObList(t1ec, t2ec));
PSubSet ps2dt("ps2dt", t, GeObList(t1ec, t2, t3ec));
PSubSet ps0dprmt("0d line", p, GeObList(pp1), GeObList(pp2));
PSubSet ps0dprml("0d plane", p, GeObList(pp1, pp2), GeObList(pp3));
PSubSet ps0dprmp("0d space", p, GeObList(pp1, pp2, pp3), GeObList(pp4));
PSubSet ps1dprmt("pencil of lines", p, GeObList(pp1), GeObList(pp2, pp3));
PSubSet ps1dprml("pencil of planes", p, GeObList(pp1, pp2),
GeObList(pp3, pp4));
PSubSet ps2dprmt("bundle of lines", p, GeObList(pp1),
GeObList(pp2, holdec, pp4));
PSubSet ps0dvrmt("0d line v", v, GeObList(v1ec), GeObList(v2ec));
PSubSet ps0dvrml("0d plane v", v, GeObList(v1ec, v2ec), GeObList(v3ec));
PSubSet ps0dvrmp("0d space v", v, GeObList(v1ec, v2ec, v3ec),
GeObList(v4ec));
PSubSet ps1dvrmt("pencil of lines v", v, GeObList(v1ec),
GeObList(v2ec, v3ec));
PSubSet ps1dvrml("pencil of planes v", v, GeObList(v1ec, v2),
GeObList(v3ec, v4ec));
PSubSet ps2dvrmt("bundle of lines v", v, GeObList(v1ec),
GeObList(v2, v3ec, v4ec));
PSubSet ps0dtrmt("0d line t", t, GeObList(t1ec), GeObList(t2));
PSubSet ps0dtrml("0d plane t", t, GeObList(t1ec, t2), GeObList(t3ec));
PSubSet ps1dtrmt("pencil of lines t", t, GeObList(t1ec),
GeObList(t2, t3ec));
// Vector subsets of vector spaces:
beauty();
truth(vs1d.Accepts() == VECTOR, TRUE);
truth(vs2d.Accepts() == VECTOR, TRUE);
truth(vs3d.Accepts() == VECTOR, TRUE);
truth(vs4d.Accepts() == VECTOR, TRUE);
truth(vs1d.IsFullSpace(), FALSE);
truth(vs2d.IsFullSpace(), FALSE);
truth(vs3d.IsFullSpace(), FALSE);
truth(vs4d.IsFullSpace(), TRUE);
truth(vs1d.IsSubset(vs1d), TRUE);
truth(vs2d.IsSubset(vs1d), TRUE);
truth(vs3d.IsSubset(vs1d), TRUE);
truth(vs4d.IsSubset(vs1d), TRUE);
truth(vs1d.IsSubset(vs2d), FALSE);
truth(vs2d.IsSubset(vs2d), TRUE);
truth(vs3d.IsSubset(vs2d), TRUE);
truth(vs4d.IsSubset(vs2d), TRUE);
truth(vs1d.IsSubset(vs3d), FALSE);
truth(vs2d.IsSubset(vs3d), FALSE);
truth(vs3d.IsSubset(vs3d), TRUE);
truth(vs4d.IsSubset(vs3d), TRUE);
truth(vs1d.IsSubset(vs4d), FALSE);
truth(vs2d.IsSubset(vs4d), FALSE);
truth(vs3d.IsSubset(vs4d), FALSE);
truth(vs4d.IsSubset(vs4d), TRUE);
VSubSet vfs = v.FullSet();
truth(vs4d.IsSubset(vfs), TRUE);
truth(vfs.IsSubset(vs4d), TRUE);
truth(vs1d.IsIn(v1), TRUE);
truth(vs1d.IsIn(v2), FALSE);
truth(vs1d.IsIn(v3), FALSE);
truth(vs1d.IsIn(v4), FALSE);
truth(vs2d.IsIn(v1), TRUE);
truth(vs2d.IsIn(v2), TRUE);
truth(vs2d.IsIn(v3), FALSE);
truth(vs2d.IsIn(v4), FALSE);
truth(vs3d.IsIn(v1), TRUE);
truth(vs3d.IsIn(v2), TRUE);
truth(vs3d.IsIn(v3), TRUE);
truth(vs3d.IsIn(v4), FALSE);
truth(vs4d.IsIn(v1), TRUE);
truth(vs4d.IsIn(v2), TRUE);
truth(vs4d.IsIn(v3), TRUE);
truth(vs4d.IsIn(v4), TRUE);
// Vector subsets of tangent vector spaces:
beauty();
truth(ts1d.Accepts() == AFF_VECTOR, TRUE);
truth(ts2d.Accepts() == AFF_VECTOR, TRUE);
truth(ts3d.Accepts() == AFF_VECTOR, TRUE);
truth(ts1d.IsFullSpace(), FALSE);
truth(ts2d.IsFullSpace(), FALSE);
truth(ts3d.IsFullSpace(), TRUE);
truth(ts1d.IsSubset(ts1d), TRUE);
truth(ts2d.IsSubset(ts1d), TRUE);
truth(ts3d.IsSubset(ts1d), TRUE);
truth(ts1d.IsSubset(ts2d), FALSE);
truth(ts2d.IsSubset(ts2d), TRUE);
truth(ts3d.IsSubset(ts2d), TRUE);
truth(ts1d.IsSubset(ts3d), FALSE);
truth(ts2d.IsSubset(ts3d), FALSE);
truth(ts3d.IsSubset(ts3d), TRUE);
VSubSet tfs = t.FullSet();
truth(ts3d.IsSubset(tfs), TRUE);
truth(tfs.IsSubset(ts3d), TRUE);
truth(ts1d.IsIn(t1), TRUE);
truth(ts1d.IsIn(t2), FALSE);
truth(ts1d.IsIn(t3), FALSE);
truth(ts2d.IsIn(t1), TRUE);
truth(ts2d.IsIn(t2), TRUE);
truth(ts2d.IsIn(t3), FALSE);
truth(ts3d.IsIn(t1), TRUE);
truth(ts3d.IsIn(t2), TRUE);
truth(ts3d.IsIn(t3), TRUE);
// Affine subsets of vector spaces:
beauty();
truth(as0dv.Accepts() == VECTOR, TRUE);
truth(as1dv.Accepts() == VECTOR, TRUE);
truth(as2dv.Accepts() == VECTOR, TRUE);
truth(as3dv.Accepts() == VECTOR, TRUE);
truth(as0dv.IsFullSpace(), FALSE);
truth(as1dv.IsFullSpace(), FALSE);
truth(as2dv.IsFullSpace(), FALSE);
truth(as3dv.IsFullSpace(), FALSE);
truth(as0dv.IsSubset(as0dv), TRUE);
truth(as1dv.IsSubset(as0dv), TRUE);
truth(as2dv.IsSubset(as0dv), TRUE);
truth(as3dv.IsSubset(as0dv), TRUE);
truth(as0dv.IsSubset(as1dv), FALSE);
truth(as1dv.IsSubset(as1dv), TRUE);
truth(as2dv.IsSubset(as1dv), TRUE);
truth(as3dv.IsSubset(as1dv), TRUE);
truth(as0dv.IsSubset(as2dv), FALSE);
truth(as1dv.IsSubset(as2dv), FALSE);
truth(as2dv.IsSubset(as2dv), TRUE);
truth(as3dv.IsSubset(as2dv), TRUE);
truth(as0dv.IsSubset(as3dv), FALSE);
truth(as1dv.IsSubset(as3dv), FALSE);
truth(as2dv.IsSubset(as3dv), FALSE);
truth(as3dv.IsSubset(as3dv), TRUE);
truth(as0dv.IsIn(v1), TRUE);
truth(as0dv.IsIn(v2), FALSE);
truth(as0dv.IsIn(v3), FALSE);
truth(as0dv.IsIn(v4), FALSE);
truth(as1dv.IsIn(v1), TRUE);
truth(as1dv.IsIn(v2), TRUE);
truth(as1dv.IsIn(v3), FALSE);
truth(as1dv.IsIn(v4), FALSE);
truth(as2dv.IsIn(v1), TRUE);
truth(as2dv.IsIn(v2), TRUE);
truth(as2dv.IsIn(v3), TRUE);
truth(as2dv.IsIn(v4), FALSE);
truth(as3dv.IsIn(v1), TRUE);
truth(as3dv.IsIn(v2), TRUE);
truth(as3dv.IsIn(v3), TRUE);
truth(as3dv.IsIn(v4), TRUE);
// Associated tangent subsets:
VSubSet vtans0 = as0dv.TangentSub();
VSubSet vtans1 = as1dv.TangentSub();
VSubSet vtans2 = as2dv.TangentSub();
VSubSet vtans3 = as3dv.TangentSub();
beauty();
truth(vtans0.Accepts() == VECTOR, TRUE);
truth(vtans1.Accepts() == VECTOR, TRUE);
truth(vtans2.Accepts() == VECTOR, TRUE);
truth(vtans3.Accepts() == VECTOR, TRUE);
truth(vtans0.IsFullSpace(), FALSE);
truth(vtans1.IsFullSpace(), FALSE);
truth(vtans2.IsFullSpace(), FALSE);
truth(vtans3.IsFullSpace(), FALSE);
truth(vtans0.IsSubset(vtans0), TRUE);
truth(vtans1.IsSubset(vtans0), TRUE);
truth(vtans2.IsSubset(vtans0), TRUE);
truth(vtans3.IsSubset(vtans0), TRUE);
truth(vtans0.IsSubset(vtans1), FALSE);
truth(vtans1.IsSubset(vtans1), TRUE);
truth(vtans2.IsSubset(vtans1), TRUE);
truth(vtans3.IsSubset(vtans1), TRUE);
truth(vtans0.IsSubset(vtans2), FALSE);
truth(vtans1.IsSubset(vtans2), FALSE);
truth(vtans2.IsSubset(vtans2), TRUE);
truth(vtans3.IsSubset(vtans2), TRUE);
truth(vtans0.IsSubset(vtans3), FALSE);
truth(vtans1.IsSubset(vtans3), FALSE);
truth(vtans2.IsSubset(vtans3), FALSE);
truth(vtans3.IsSubset(vtans3), TRUE);
truth(vtans0.IsIn(v1 - v1), TRUE);
truth(vtans0.IsIn(v2 - v1), FALSE);
truth(vtans0.IsIn(v3 - v1), FALSE);
truth(vtans0.IsIn(v4 - v1), FALSE);
truth(vtans1.IsIn(v1 - v1), TRUE);
truth(vtans1.IsIn(v2 - v1), TRUE);
truth(vtans1.IsIn(v3 - v1), FALSE);
truth(vtans1.IsIn(v4 - v1), FALSE);
truth(vtans2.IsIn(v1 - v1), TRUE);
truth(vtans2.IsIn(v2 - v1), TRUE);
truth(vtans2.IsIn(v3 - v1), TRUE);
truth(vtans2.IsIn(v4 - v1), FALSE);
truth(vtans3.IsIn(v1 - v1), TRUE);
truth(vtans3.IsIn(v2 - v1), TRUE);
truth(vtans3.IsIn(v3 - v1), TRUE);
truth(vtans3.IsIn(v4 - v1), TRUE);
// Affine subsets of affine spaces:
beauty();
truth(as0da.Accepts() == AFF_POINT, TRUE);
truth(as1da.Accepts() == AFF_POINT, TRUE);
truth(as2da.Accepts() == AFF_POINT, TRUE);
truth(as3da.Accepts() == AFF_POINT, TRUE);
truth(as0da.IsFullSpace(), FALSE);
truth(as1da.IsFullSpace(), FALSE);
truth(as2da.IsFullSpace(), FALSE);
truth(as3da.IsFullSpace(), TRUE);
truth(as0da.IsSubset(as0da), TRUE);
truth(as1da.IsSubset(as0da), TRUE);
truth(as2da.IsSubset(as0da), TRUE);
truth(as3da.IsSubset(as0da), TRUE);
truth(as0da.IsSubset(as1da), FALSE);
truth(as1da.IsSubset(as1da), TRUE);
truth(as2da.IsSubset(as1da), TRUE);
truth(as3da.IsSubset(as1da), TRUE);
truth(as0da.IsSubset(as2da), FALSE);
truth(as1da.IsSubset(as2da), FALSE);
truth(as2da.IsSubset(as2da), TRUE);
truth(as3da.IsSubset(as2da), TRUE);
truth(as0da.IsSubset(as3da), FALSE);
truth(as1da.IsSubset(as3da), FALSE);
truth(as2da.IsSubset(as3da), FALSE);
truth(as3da.IsSubset(as3da), TRUE);
ASubSet afs = a.FullSet();
truth(as3da.IsSubset(afs), TRUE);
truth(afs.IsSubset(as3da), TRUE);
truth(as0da.IsIn(p1), TRUE);
truth(as0da.IsIn(p2), FALSE);
truth(as0da.IsIn(hold), FALSE);
truth(as0da.IsIn(p4), FALSE);
truth(as1da.IsIn(p1), TRUE);
truth(as1da.IsIn(p2), TRUE);
truth(as1da.IsIn(hold), FALSE);
truth(as1da.IsIn(p4), FALSE);
truth(as2da.IsIn(p1), TRUE);
truth(as2da.IsIn(p2), TRUE);
truth(as2da.IsIn(hold), TRUE);
truth(as2da.IsIn(p4), FALSE);
truth(as3da.IsIn(p1), TRUE);
truth(as3da.IsIn(p2), TRUE);
truth(as3da.IsIn(hold), TRUE);
truth(as3da.IsIn(p4), TRUE);
// Associated tangent subsets:
VSubSet atans0 = as0da.TangentSub();
VSubSet atans1 = as1da.TangentSub();
VSubSet atans2 = as2da.TangentSub();
VSubSet atans3 = as3da.TangentSub();
beauty();
truth(atans0.Accepts() == AFF_VECTOR, TRUE);
truth(atans1.Accepts() == AFF_VECTOR, TRUE);
truth(atans2.Accepts() == AFF_VECTOR, TRUE);
truth(atans3.Accepts() == AFF_VECTOR, TRUE);
truth(atans0.IsFullSpace(), FALSE);
truth(atans1.IsFullSpace(), FALSE);
truth(atans2.IsFullSpace(), FALSE);
truth(atans3.IsFullSpace(), TRUE);
truth(atans0.IsSubset(atans0), TRUE);
truth(atans1.IsSubset(atans0), TRUE);
truth(atans2.IsSubset(atans0), TRUE);
truth(atans3.IsSubset(atans0), TRUE);
truth(atans0.IsSubset(atans1), FALSE);
truth(atans1.IsSubset(atans1), TRUE);
truth(atans2.IsSubset(atans1), TRUE);
truth(atans3.IsSubset(atans1), TRUE);
truth(atans0.IsSubset(atans2), FALSE);
truth(atans1.IsSubset(atans2), FALSE);
truth(atans2.IsSubset(atans2), TRUE);
truth(atans3.IsSubset(atans2), TRUE);
truth(atans0.IsSubset(atans3), FALSE);
truth(atans1.IsSubset(atans3), FALSE);
truth(atans2.IsSubset(atans3), FALSE);
truth(atans3.IsSubset(atans3), TRUE);
VSubSet tfs0 = t.FullSet();
truth(atans3.IsSubset(tfs0), TRUE);
truth(tfs0.IsSubset(atans3), TRUE);
truth(atans0.IsIn(p1 - p1), TRUE);
truth(atans0.IsIn(p2 - p1), FALSE);
truth(atans0.IsIn(p3 - p1), FALSE);
truth(atans0.IsIn(p4 - p1), FALSE);
truth(atans1.IsIn(p1 - p1), TRUE);
truth(atans1.IsIn(p2 - p1), TRUE);
truth(atans1.IsIn(p3 - p1), FALSE);
truth(atans1.IsIn(p4 - p1), FALSE);
truth(atans2.IsIn(p1 - p1), TRUE);
truth(atans2.IsIn(p2 - p1), TRUE);
truth(atans2.IsIn(p3 - p1), TRUE);
truth(atans2.IsIn(p4 - p1), FALSE);
truth(atans3.IsIn(p1 - p1), TRUE);
truth(atans3.IsIn(p2 - p1), TRUE);
truth(atans3.IsIn(p3 - p1), TRUE);
truth(atans3.IsIn(p4 - p1), TRUE);
// Affine subsets of tangent vector spaces:
beauty();
truth(as0dt.Accepts() == AFF_VECTOR, TRUE);
truth(as1dt.Accepts() == AFF_VECTOR, TRUE);
truth(as2dt.Accepts() == AFF_VECTOR, TRUE);
truth(as0dt.IsFullSpace(), FALSE);
truth(as1dt.IsFullSpace(), FALSE);
truth(as2dt.IsFullSpace(), FALSE);
truth(as0dt.IsSubset(as0dt), TRUE);
truth(as1dt.IsSubset(as0dt), TRUE);
truth(as2dt.IsSubset(as0dt), TRUE);
truth(as0dt.IsSubset(as1dt), FALSE);
truth(as1dt.IsSubset(as1dt), TRUE);
truth(as2dt.IsSubset(as1dt), TRUE);
truth(as0dt.IsSubset(as2dt), FALSE);
truth(as1dt.IsSubset(as2dt), FALSE);
truth(as2dt.IsSubset(as2dt), TRUE);
truth(as0dt.IsIn(t1), TRUE);
truth(as0dt.IsIn(t2), FALSE);
truth(as0dt.IsIn(t3), FALSE);
truth(as1dt.IsIn(t1), TRUE);
truth(as1dt.IsIn(t2), TRUE);
truth(as1dt.IsIn(t3), FALSE);
truth(as2dt.IsIn(t1), TRUE);
truth(as2dt.IsIn(t2), TRUE);
truth(as2dt.IsIn(t3), TRUE);
// Associated tangent subsets:
VSubSet ttans0 = as0dt.TangentSub();
VSubSet ttans1 = as1dt.TangentSub();
VSubSet ttans2 = as2dt.TangentSub();
beauty();
truth(ttans0.Accepts() == AFF_VECTOR, TRUE);
truth(ttans1.Accepts() == AFF_VECTOR, TRUE);
truth(ttans2.Accepts() == AFF_VECTOR, TRUE);
truth(ttans0.IsFullSpace(), FALSE);
truth(ttans1.IsFullSpace(), FALSE);
truth(ttans2.IsFullSpace(), FALSE);
truth(ttans0.IsSubset(ttans0), TRUE);
truth(ttans1.IsSubset(ttans0), TRUE);
truth(ttans2.IsSubset(ttans0), TRUE);
truth(ttans0.IsSubset(ttans1), FALSE);
truth(ttans1.IsSubset(ttans1), TRUE);
truth(ttans2.IsSubset(ttans1), TRUE);
truth(ttans0.IsSubset(ttans2), FALSE);
truth(ttans1.IsSubset(ttans2), FALSE);
truth(ttans2.IsSubset(ttans2), TRUE);
truth(ttans0.IsIn(t1 - t1), TRUE);
truth(ttans0.IsIn(t2 - t1), FALSE);
truth(ttans0.IsIn(t3 - t1), FALSE);
truth(ttans1.IsIn(t1 - t1), TRUE);
truth(ttans1.IsIn(t2 - t1), TRUE);
truth(ttans1.IsIn(t3 - t1), FALSE);
truth(ttans2.IsIn(t1 - t1), TRUE);
truth(ttans2.IsIn(t2 - t1), TRUE);
truth(ttans2.IsIn(t3 - t1), TRUE);
// Affine subsets of projective spaces:
beauty();
truth(as1dp.Accepts() == PROJ_POINT, TRUE);
truth(as2dp.Accepts() == PROJ_POINT, TRUE);
truth(as3dp.Accepts() == PROJ_POINT, TRUE);
truth(as1dp.IsFullSpace(), FALSE);
truth(as2dp.IsFullSpace(), FALSE);
truth(as3dp.IsFullSpace(), FALSE);
GeObList inf1 = as1dp.AtInfinity();
GeObList inf2 = as2dp.AtInfinity();
GeObList inf3 = as3dp.AtInfinity();
truth(inf1.Length() == 1, TRUE);
truth(inf2.Length() == 2, TRUE);
truth(inf3.Length() == 3, TRUE);
truth(as1dp.IsIn(inf1[0]), FALSE);
truth(as2dp.IsIn(inf2[0]), FALSE);
truth(as2dp.IsIn(inf2[1]), FALSE);
truth(as3dp.IsIn(inf3[0]), FALSE);
truth(as3dp.IsIn(inf3[1]), FALSE);
truth(as3dp.IsIn(inf3[2]), FALSE);
truth(as1dp.IsSubset(as1dp), TRUE);
truth(as2dp.IsSubset(as1dp), TRUE);
truth(as3dp.IsSubset(as1dp), TRUE);
truth(as1dp.IsSubset(as2dp), FALSE);
truth(as2dp.IsSubset(as2dp), TRUE);
truth(as3dp.IsSubset(as2dp), TRUE);
truth(as1dp.IsSubset(as3dp), FALSE);
truth(as2dp.IsSubset(as3dp), FALSE);
truth(as3dp.IsSubset(as3dp), TRUE);
truth(as1dp.IsIn(pp1), TRUE);
truth(as1dp.IsIn(pp2), FALSE);
truth(as1dp.IsIn(holdec), FALSE);
truth(as1dp.IsIn(pp4), FALSE);
PPoint holdpp = (pp1 + pp2) / 2.0;
truth(as1dp.IsIn(holdpp), TRUE);
// A kludge, but affine combinations work because points at infinity
// in these subsets are not points at infinity in standard subset:
truth(as2dp.IsIn(pp1), TRUE);
truth(as2dp.IsIn(pp2), FALSE);
truth(as2dp.IsIn(holdec), FALSE);
truth(as2dp.IsIn(pp4), FALSE);
holdpp = (pp1 + pp2 + pp3) / 3;
truth(as2dp.IsIn(holdpp), TRUE);
truth(as3dp.IsIn(pp1), TRUE);
truth(as3dp.IsIn(pp2), FALSE);
truth(as3dp.IsIn(holdec), FALSE);
truth(as3dp.IsIn(pp4), FALSE);
holdpp = (pp1 + pp2 + pp3 + pp4) / 4;
truth(as3dp.IsIn(holdpp), TRUE);
// Projective subsets of projective spaces:
beauty();
truth(ps0dp.Accepts() == PROJ_POINT, TRUE);
truth(ps1dp.Accepts() == PROJ_POINT, TRUE);
truth(ps2dp.Accepts() == PROJ_POINT, TRUE);
truth(ps3dp.Accepts() == PROJ_POINT, TRUE);
truth(ps0dp.IsFullSpace(), FALSE);
truth(ps1dp.IsFullSpace(), FALSE);
truth(ps2dp.IsFullSpace(), FALSE);
truth(ps3dp.IsFullSpace(), TRUE);
truth(ps0dp.HasRemovedPoints(), FALSE);
truth(ps1dp.HasRemovedPoints(), FALSE);
truth(ps2dp.HasRemovedPoints(), FALSE);
truth(ps3dp.HasRemovedPoints(), FALSE);
truth(ps0dp.IsSubset(ps0dp), TRUE);
truth(ps1dp.IsSubset(ps0dp), TRUE);
truth(ps2dp.IsSubset(ps0dp), TRUE);
truth(ps3dp.IsSubset(ps0dp), TRUE);
truth(ps0dp.IsSubset(ps1dp), FALSE);
truth(ps1dp.IsSubset(ps1dp), TRUE);
truth(ps2dp.IsSubset(ps1dp), TRUE);
truth(ps3dp.IsSubset(ps1dp), TRUE);
truth(ps0dp.IsSubset(ps2dp), FALSE);
truth(ps1dp.IsSubset(ps2dp), FALSE);
truth(ps2dp.IsSubset(ps2dp), TRUE);
truth(ps3dp.IsSubset(ps2dp), TRUE);
truth(ps0dp.IsSubset(ps3dp), FALSE);
truth(ps1dp.IsSubset(ps3dp), FALSE);
truth(ps2dp.IsSubset(ps3dp), FALSE);
truth(ps3dp.IsSubset(ps3dp), TRUE);
PSubSet pfs = p.FullSet();
truth(ps3dp.IsSubset(pfs), TRUE);
truth(pfs.IsSubset(ps3dp), TRUE);
truth(ps0dp.IsIn(pp1), TRUE);
truth(ps0dp.IsIn(pp2), FALSE);
truth(ps0dp.IsIn(holdec), FALSE);
truth(ps0dp.IsIn(pp4), FALSE);
truth(ps1dp.IsIn(pp1), TRUE);
truth(ps1dp.IsIn(pp2), TRUE);
truth(ps1dp.IsIn(holdec), FALSE);
truth(ps1dp.IsIn(pp4), FALSE);
truth(ps2dp.IsIn(pp1), TRUE);
truth(ps2dp.IsIn(pp2), TRUE);
truth(ps2dp.IsIn(holdec), TRUE);
truth(ps2dp.IsIn(pp4), FALSE);
truth(ps3dp.IsIn(pp1), TRUE);
truth(ps3dp.IsIn(pp2), TRUE);
truth(ps3dp.IsIn(holdec), TRUE);
truth(ps3dp.IsIn(pp4), TRUE);
// Projective subsets of vector spaces:
beauty();
truth(ps0dv.Accepts() == VEC_EC, TRUE);
truth(ps1dv.Accepts() == VEC_EC, TRUE);
truth(ps2dv.Accepts() == VEC_EC, TRUE);
truth(ps3dv.Accepts() == VEC_EC, TRUE);
truth(ps0dv.IsFullSpace(), FALSE);
truth(ps1dv.IsFullSpace(), FALSE);
truth(ps2dv.IsFullSpace(), FALSE);
truth(ps3dv.IsFullSpace(), TRUE);
truth(ps0dv.HasRemovedPoints(), FALSE);
truth(ps1dv.HasRemovedPoints(), FALSE);
truth(ps2dv.HasRemovedPoints(), FALSE);
truth(ps3dv.HasRemovedPoints(), FALSE);
truth(ps0dv.IsSubset(ps0dv), TRUE);
truth(ps1dv.IsSubset(ps0dv), TRUE);
truth(ps2dv.IsSubset(ps0dv), TRUE);
truth(ps3dv.IsSubset(ps0dv), TRUE);
truth(ps0dv.IsSubset(ps1dv), FALSE);
truth(ps1dv.IsSubset(ps1dv), TRUE);
truth(ps2dv.IsSubset(ps1dv), TRUE);
truth(ps3dv.IsSubset(ps1dv), TRUE);
truth(ps0dv.IsSubset(ps2dv), FALSE);
truth(ps1dv.IsSubset(ps2dv), FALSE);
truth(ps2dv.IsSubset(ps2dv), TRUE);
truth(ps3dv.IsSubset(ps2dv), TRUE);
truth(ps0dv.IsSubset(ps3dv), FALSE);
truth(ps1dv.IsSubset(ps3dv), FALSE);
truth(ps2dv.IsSubset(ps3dv), FALSE);
truth(ps3dv.IsSubset(ps3dv), TRUE);
PSubSet vpfs = v.FullProjSet();
truth(ps3dv.IsSubset(vpfs), TRUE);
truth(vpfs.IsSubset(ps3dv), TRUE);
truth(ps0dv.IsIn(v1ec), TRUE);
truth(ps0dv.IsIn(v2), FALSE);
truth(ps0dv.IsIn(v3ec), FALSE);
truth(ps0dv.IsIn(v4ec), FALSE);
truth(ps1dv.IsIn(v1ec), TRUE);
truth(ps1dv.IsIn(v2), TRUE);
truth(ps1dv.IsIn(v3ec), FALSE);
truth(ps1dv.IsIn(v4), FALSE);
truth(ps2dv.IsIn(v1ec), TRUE);
truth(ps2dv.IsIn(v2), TRUE);
truth(ps2dv.IsIn(v3ec), TRUE);
truth(ps2dv.IsIn(v4), FALSE);
truth(ps3dv.IsIn(v1ec), TRUE);
truth(ps3dv.IsIn(v2), TRUE);
truth(ps3dv.IsIn(v3ec), TRUE);
truth(ps3dv.IsIn(v4), TRUE);
// Projective subsets of tangent vector spaces:
beauty();
truth(ps0dt.Accepts() == AFF_VEC_EC, TRUE);
truth(ps1dt.Accepts() == AFF_VEC_EC, TRUE);
truth(ps2dt.Accepts() == AFF_VEC_EC, TRUE);
truth(ps0dt.IsFullSpace(), FALSE);
truth(ps1dt.IsFullSpace(), FALSE);
truth(ps2dt.IsFullSpace(), TRUE);
truth(ps0dt.HasRemovedPoints(), FALSE);
truth(ps1dt.HasRemovedPoints(), FALSE);
truth(ps2dt.HasRemovedPoints(), FALSE);
truth(ps0dt.IsSubset(ps0dt), TRUE);
truth(ps1dt.IsSubset(ps0dt), TRUE);
truth(ps2dt.IsSubset(ps0dt), TRUE);
truth(ps0dt.IsSubset(ps1dt), FALSE);
truth(ps1dt.IsSubset(ps1dt), TRUE);
truth(ps2dt.IsSubset(ps1dt), TRUE);
truth(ps0dt.IsSubset(ps2dt), FALSE);
truth(ps1dt.IsSubset(ps2dt), FALSE);
truth(ps2dt.IsSubset(ps2dt), TRUE);
PSubSet ptfs = t.FullProjSet();
truth(ps2dt.IsSubset(ptfs), TRUE);
truth(ptfs.IsSubset(ps2dt), TRUE);
truth(ps0dt.IsIn(t1ec), TRUE);
truth(ps0dt.IsIn(t2), FALSE);
truth(ps0dt.IsIn(t3ec), FALSE);
truth(ps1dt.IsIn(t1ec), TRUE);
truth(ps1dt.IsIn(t2), TRUE);
truth(ps1dt.IsIn(t3ec), FALSE);
truth(ps2dt.IsIn(t1ec), TRUE);
truth(ps2dt.IsIn(t2), TRUE);
truth(ps2dt.IsIn(t3ec), TRUE);
// Projective subsets of projective spaces with removed points:
beauty();
truth(ps0dprmt.Accepts() == PROJ_POINT, TRUE);
truth(ps0dprml.Accepts() == PROJ_POINT, TRUE);
truth(ps0dprmp.Accepts() == PROJ_POINT, TRUE);
truth(ps1dprmt.Accepts() == PROJ_POINT, TRUE);
truth(ps1dprml.Accepts() == PROJ_POINT, TRUE);
truth(ps2dprmt.Accepts() == PROJ_POINT, TRUE);
truth(ps0dprmt.IsFullSpace(), FALSE);
truth(ps0dprml.IsFullSpace(), FALSE);
truth(ps0dprmp.IsFullSpace(), FALSE);
truth(ps1dprmt.IsFullSpace(), FALSE);
truth(ps1dprml.IsFullSpace(), FALSE);
truth(ps2dprmt.IsFullSpace(), FALSE);
truth(ps0dprmt.HasRemovedPoints(), TRUE);
truth(ps0dprml.HasRemovedPoints(), TRUE);
truth(ps0dprmp.HasRemovedPoints(), TRUE);
truth(ps1dprmt.HasRemovedPoints(), TRUE);
truth(ps1dprml.HasRemovedPoints(), TRUE);
truth(ps2dprmt.HasRemovedPoints(), TRUE);
truth(ps0dprmt.IsIn(pp1), FALSE);
truth(ps0dprmt.IsIn(pp2), TRUE);
truth(ps0dprmt.IsIn(holdec), FALSE);
truth(ps0dprmt.IsIn(pp4), FALSE);
truth(ps0dprml.IsIn(pp1), FALSE);
truth(ps0dprml.IsIn(pp2), FALSE);
truth(ps0dprml.IsIn(holdec), TRUE);
truth(ps0dprml.IsIn(pp4), FALSE);
truth(ps0dprmp.IsIn(pp1), FALSE);
truth(ps0dprmp.IsIn(pp2), FALSE);
truth(ps0dprmp.IsIn(holdec), FALSE);
truth(ps0dprmp.IsIn(pp4), TRUE);
truth(ps1dprmt.IsIn(pp1), FALSE);
truth(ps1dprmt.IsIn(pp2), TRUE);
truth(ps1dprmt.IsIn(holdec), TRUE);
truth(ps1dprmt.IsIn(pp4), FALSE);
truth(ps1dprml.IsIn(pp1), FALSE);
truth(ps1dprml.IsIn(pp2), FALSE);
truth(ps1dprml.IsIn(holdec), TRUE);
truth(ps1dprml.IsIn(pp4), TRUE);
truth(ps2dprmt.IsIn(pp1), FALSE);
truth(ps2dprmt.IsIn(pp2), TRUE);
truth(ps2dprmt.IsIn(holdec), TRUE);
truth(ps2dprmt.IsIn(pp4), TRUE);
// Projective subsets of vector spaces with removed points:
beauty();
truth(ps0dvrmt.Accepts() == VEC_EC, TRUE);
truth(ps0dvrml.Accepts() == VEC_EC, TRUE);
truth(ps0dvrmp.Accepts() == VEC_EC, TRUE);
truth(ps1dvrmt.Accepts() == VEC_EC, TRUE);
truth(ps1dvrml.Accepts() == VEC_EC, TRUE);
truth(ps2dvrmt.Accepts() == VEC_EC, TRUE);
truth(ps0dvrmt.IsFullSpace(), FALSE);
truth(ps0dvrml.IsFullSpace(), FALSE);
truth(ps0dvrmp.IsFullSpace(), FALSE);
truth(ps1dvrmt.IsFullSpace(), FALSE);
truth(ps1dvrml.IsFullSpace(), FALSE);
truth(ps2dvrmt.IsFullSpace(), FALSE);
truth(ps0dvrmt.HasRemovedPoints(), TRUE);
truth(ps0dvrml.HasRemovedPoints(), TRUE);
truth(ps0dvrmp.HasRemovedPoints(), TRUE);
truth(ps1dvrmt.HasRemovedPoints(), TRUE);
truth(ps1dvrml.HasRemovedPoints(), TRUE);
truth(ps2dvrmt.HasRemovedPoints(), TRUE);
truth(ps0dvrmt.IsIn(v1ec), FALSE);
truth(ps0dvrmt.IsIn(v2ec), TRUE);
truth(ps0dvrmt.IsIn(v3), FALSE);
truth(ps0dvrmt.IsIn(v4ec), FALSE);
truth(ps0dvrml.IsIn(v1ec), FALSE);
truth(ps0dvrml.IsIn(v2ec), FALSE);
truth(ps0dvrml.IsIn(v3), TRUE);
truth(ps0dvrml.IsIn(v4ec), FALSE);
truth(ps0dvrmp.IsIn(v1ec), FALSE);
truth(ps0dvrmp.IsIn(v2), FALSE);
truth(ps0dvrmp.IsIn(v3ec), FALSE);
truth(ps0dvrmp.IsIn(v4ec), TRUE);
truth(ps1dvrmt.IsIn(v1ec), FALSE);
truth(ps1dvrmt.IsIn(v2ec), TRUE);
truth(ps1dvrmt.IsIn(v3), TRUE);
truth(ps1dvrmt.IsIn(v4ec), FALSE);
truth(ps1dvrml.IsIn(v1ec), FALSE);
truth(ps1dvrml.IsIn(v2ec), FALSE);
truth(ps1dvrml.IsIn(v3), TRUE);
truth(ps1dvrml.IsIn(v4ec), TRUE);
truth(ps2dvrmt.IsIn(v1ec), FALSE);
truth(ps2dvrmt.IsIn(v2), TRUE);
truth(ps2dvrmt.IsIn(v3ec), TRUE);
truth(ps2dvrmt.IsIn(v4ec), TRUE);
// Projective subsets of tangent vector spaces with removed points:
beauty();
truth(ps0dtrmt.Accepts() == AFF_VEC_EC, TRUE);
truth(ps0dtrml.Accepts() == AFF_VEC_EC, TRUE);
truth(ps1dtrmt.Accepts() == AFF_VEC_EC, TRUE);
truth(ps0dtrmt.IsFullSpace(), FALSE);
truth(ps0dtrml.IsFullSpace(), FALSE);
truth(ps1dtrmt.IsFullSpace(), FALSE);
truth(ps0dtrmt.HasRemovedPoints(), TRUE);
truth(ps0dtrml.HasRemovedPoints(), TRUE);
truth(ps1dtrmt.HasRemovedPoints(), TRUE);
truth(ps0dtrmt.IsIn(t1ec), FALSE);
truth(ps0dtrmt.IsIn(t2), TRUE);
truth(ps0dtrmt.IsIn(t3ec), FALSE);
truth(ps0dtrml.IsIn(t1ec), FALSE);
truth(ps0dtrml.IsIn(t2), FALSE);
truth(ps0dtrml.IsIn(t3ec), TRUE);
truth(ps1dtrmt.IsIn(t1ec), FALSE);
truth(ps1dtrmt.IsIn(t2ec), TRUE);
truth(ps1dtrmt.IsIn(t3), TRUE);
}